package fr.pascal;

public class Kangourou {

	private String nom;
	private int age;
	private String pelage;

	public Kangourou(String nom, int age, String pelage) {
		this.nom = nom;
		this.age = age;
		this.pelage = pelage;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getPelage() {
		return pelage;
	}

	public void setPelage(String pelage) {
		this.pelage = pelage;
	}

	@Override
	public String toString() {
		return " [" + nom + ", " + age + ", " + pelage + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + age;
		result = prime * result + ((nom == null) ? 0 : nom.hashCode());
		result = prime * result + ((pelage == null) ? 0 : pelage.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Kangourou other = (Kangourou) obj;
		if (age != other.age)
			return false;
		if (nom == null) {
			if (other.nom != null)
				return false;
		} else if (!nom.equals(other.nom))
			return false;
		if (pelage == null) {
			if (other.pelage != null)
				return false;
		} else if (!pelage.equals(other.pelage))
			return false;
		return true;
	}
}
